package com.rgs.base.core.util.excel.bo;


import com.rgs.base.core.util.excel.ExcelColumnAnnotation;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Ren Gaoshuai
 * @date 2022-03-08 15:45
 **/
@Data
@NoArgsConstructor
public class ImportFileErrorBO {
    /**
     * 关键词（类似于手机号，设备编号等方便快速查询原因的信息）
     */
    @ExcelColumnAnnotation(columnName = "关键词")
    private String keyWord;
    /**
     * 失败原因
     */
    @ExcelColumnAnnotation(columnName = "原因")
    private String reason = "导入失败";
    /**
     * 备注（用于标记失败的具体内容）
     */
    @ExcelColumnAnnotation(columnName = "备注")
    private String notes;

    /**
     * true 异常，false 正常
     */
    private Boolean isError;

    /**
     * 返回方法执行得到的对象或者模型
     */
    private Object returnObj;

    public ImportFileErrorBO(String reason) {
        this.reason = reason;
//        this.notes = notes;
        this.isError = true;
    }

    public ImportFileErrorBO(String reason, String notes, Boolean isError) {
        this.reason = reason;
        this.notes = notes;
        this.isError = isError;
    }

    public ImportFileErrorBO(String keyWord, String reason, String notes) {
        this.keyWord = keyWord;
        this.reason = reason;
        this.notes = notes;
    }
//
//    private static final List<String> FILE_ERROR_IGNORE =
//            ReflectUtil.getFieldMap(ImportFileErrorBO.class).entrySet()
//                    .stream().filter(q -> !q.getValue().isAnnotationPresent(ExcelColumnAnnotation.class))
//                    .map(Map.Entry::getKey).collect(Collectors.toList());


}
